package com.nulldev.util.crypto.api3.encryptors.unsupported;

import java.nio.charset.Charset;

import com.nulldev.util.crypto.api2.Cryptable;
import com.nulldev.util.string.StringsUtil;

public class P2PXl extends Cryptable {
	
	public P2PXl() {
		super("p2pX.l");
	}

	@Override
	public String encrypt(String object, String pass) {
		return this.encrypt(object, pass, null);
	}

	@Override
	public String encrypt(String object, String pass, Charset charset) {
		final String pass1 = StringsUtil.mul(object, pass);
		return StringsUtil.toIDL(pass1);
	}

	@Override
	public String decrypt(String object, String pass) {
		return this.decrypt(object, pass, null);
	}

	@Override
	public String decrypt(String object, String pass, Charset charset) {
		final String pass1 = StringsUtil.unmul(StringsUtil.fromIDL(object), pass);
		return pass1;
	}
}
